#include <iostream>
using namespace std;
class People
{

public:
    char name;
    People(char name) : name{name}
    {
    }
};
class Student : public People
{
public:
    int classNo;
    Student(char name, int classNo) : People{name}, classNo{classNo}
    {
    }
};
void print_people(People p)
// 函数对象切片
// 此时 p 就是 People的实例， 派生部分永久丢失 无法访问子类属性
{
    cout << p.name << endl;
}
int main()
{
    People p1('A');
    Student s1('B', 2);
    print_people(p1);
    print_people(s1);
    return 0;
}
